<template>
  <el-container>
    <el-main>
      <el-descriptions title="结点详情" direction="horizontal" :column="2" border>
        <el-descriptions-item label="结点id" :span="1">{{content.roadNodesId}}</el-descriptions-item>
        <el-descriptions-item label="所属路段id">{{content.roadSegsId}}</el-descriptions-item>
        <el-descriptions-item label="所属高速公路" >{{content.highRoadsId}}</el-descriptions-item>
        <el-descriptions-item label="结点名称">{{content.nodeName}}</el-descriptions-item>
        <el-descriptions-item label="结点类型">{{content.nodeType}}</el-descriptions-item>
        <el-descriptions-item label="限高" >{{content.truckHeight}}</el-descriptions-item>
        <el-descriptions-item label="限宽" >{{content.truckWidth}}</el-descriptions-item>
        <el-descriptions-item label="经度" >{{content.longitude}}</el-descriptions-item>
        <el-descriptions-item label="纬度">{{content.latitude}}</el-descriptions-item>
        <el-descriptions-item label="所在州市">{{content.indexCities}}</el-descriptions-item>
        <el-descriptions-item label="结点状态">{{content.nodeState}}</el-descriptions-item>
        <el-descriptions-item label="备注" :span="2">{{content.nodeComment}}</el-descriptions-item>
      </el-descriptions>
    </el-main>
  </el-container>

</template>

<script>
import axios from "axios";
import {ElMessage} from "element-plus";

export default {
  name: "roadNodesChild",
  props:{
    roadNodesId: Number
  },
  data(){
    return{
      content: {
        highRoads: null,
        highRoadsId: null,
        indexCities: "岳阳市",
        latitude: "29.440325",
        longitude: "113.260790",
        nodeComment: null,
        nodeName: "云溪收费站(G0421许广高速入口)",
        nodeState: true,
        nodeType: "收费站",
        roadNodesId: 1222,
        roadSegs: null,
        roadSegsId: null,
        truckHeight: 20,
        truckWidth: 10,


      },

      }
  },
  mounted() {
    axios({
      method: 'post',
      url: '/api/road/selectRoadNode',
      params:{
        id:this.roadNodesId
      }
    })
        .then((res)=>{

          if(res.data.code==="1"){//返回成功
            this.content=res.data.data.roadNode
          }else{//返回失败
            // alert("")
            ElMessage.error('查询失败')
            this.$emit('wrong')
          }
        });
  }
}
</script>

<style scoped>
.el-container{
  height: 550px!important;
  width: 100%;
}
</style>